package com.bw.day03

import android.content.Intent
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.alibaba.android.arouter.facade.annotation.Route
import com.bw.base.net.mvvm.BaseActivity
import com.bw.base.net.mvvm.BaseViewActivity
import com.bw.day03.databinding.ActivityMainBinding
import com.bw.day03.userinfo.UserViewModel

@Route(path = "/app/MainActivity")
class MainActivity : BaseActivity<ActivityMainBinding,UserViewModel>() {
    override fun initView() {
        viewModel.user()
//        binding.number.setOnClickListener {
//            startActivity(Intent(this,MainActivity2::class.java))
//        }

    }

    override fun initData() {
        viewModel.userSuccess.observe(this){
            if (it.code==200){
                binding.info=it.data
            }
        }
    }

    override fun getViewModel(): Class<UserViewModel> = UserViewModel::class.java

    override fun getLayoutId(): Int =R.layout.activity_main

}